<!DOCTYPE html>
<html lang="en"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>医生排班</title>
    <link rel="stylesheet" href="/css/bootstrap.min.css" />
    <link rel="stylesheet" href="/css/mainstyle.css" />
</head>
<body>
<div th:insert="~{doctor/header}"></div>
<main id="main">
    <!--副标题-->
    <section class="breadcrumbs">
        <div class="container">
            <div class="d-flex justify-content-between align-items-center">
                <h2>我的排班</h2>
                <ol>
                    <li><a href="#">首页</a></li>
                    <li><a href="#">我的排班</a></li>
                </ol>
            </div>
        </div>
    </section>
    <section class="inner-page">
        <div class="container">
            <div class="card">
                <div class="card-header">
                    <h3 class="card-title">我的排班</h3>
                </div>
                <div class="card-body">
                    <div class="table-responsive">
                        <table class="table ">
                            <tbody>
                            <tr>
                                <th>医生姓名</th>
                                <th>科室</th>
                                <th>就诊数量</th>
                                <th>周几</th>
                            </tr>
                            <tr th:each="plan : ${plans}">
                                <td th:text="${plan.doctorName}"></td>
                                <td th:text="${plan.departmentName}"></td>
                                <td th:text="${plan.num}"></td>
                                <td th:inline="javascript">
                                    <script th:inline="javascript">
                                        /*<![CDATA[*/
                                        var weekdayEn = /*[[${plan.weekday}]]*/ 'Sunday'; // 默认值
                                        var weekdaysZh = {
                                            'Monday': '星期一',
                                            'Tuesday': '星期二',
                                            'Wednesday': '星期三',
                                            'Thursday': '星期四',
                                            'Friday': '星期五',
                                            'Saturday': '星期六',
                                            'Sunday': '星期天'
                                        };
                                        var weekdayZh = weekdaysZh[weekdayEn] || '未知';
                                        document.write(weekdayZh);
                                        /*]]>*/
                                    </script>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4" style="border: none;">
                                    <ul class="pagination justify-content-center">
                                        <li class="page-item" th:if="${currentPage} != 1">
                                            <a class="page-link"
                                               th:href="@{/doctor/selectAllDoctorsByPage(currentPage=${currentPage - 1})}">上一页</a>
                                        </li>
                                        <li class="page-item disabled"><a class="page-link">第<span
                                                th:text="${currentPage}"></span>页</a></li>
                                        <li class="page-item disabled"><a class="page-link">共<span
                                                th:text="${totalPage}"></span>页</a></li>
                                        <li class="page-item" th:if="${currentPage} !=${totalPage}">
                                            <a class="page-link"
                                               th:href="@{/doctor/selectAllDoctorsByPage(currentPage=${currentPage + 1})}">下一页</a>
                                        </li>
                                    </ul>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </section>
</main>
</body>
</html>